package cn.handong.tool.多线程;

import org.junit.Test;
import org.springframework.scheduling.annotation.Async;

public class ThreadPoolTest {

    @Test
    public void testSpeed() throws InterruptedException {
        for (int i = 0; i < 10; i++) {
            speed(i);
        }
    }

    @Async("TestExecutor")
    public void speed(Integer i) throws InterruptedException {
        Thread.sleep(1000);
        System.out.println(i);
    }


}
